row = 1
while row <= 9:
    col = 1
    while col <= row:
        print("%d * %d = %d\t" % (col, row, col * row), end=" ")
        col += 1
    print()

    row += 1

print("-" * 100)

row = 9
while row >= 1:
    col = 1
    while col <= row:
        print("%d * %d = %d\t" % (col, row, col * row), end=" ")
        col += 1
    print()

    row -= 1

